<!--
  // Creation History
  // --------------------------------------------------------------
  //	Company:			HTHK
  //	NAME:				DaySpendReport.jsp
  //	TITLE:				
  //	FUNCTION:			
  //	BY:					Beyes Xia
  //	DATE:				2004-4-19 15:44
  // --------------------------------------------------------------
-->

<html>
<%@ include file="../tssheader.jsp" %>
<%@ page import="java.util.*" %>
<%@ page import="java.lang.*" %>
<%@ page import="tss.options.*" %>
<%
	String staff_name = "";
	String project_name = "";
	String date_from = "";
	String date_to = "";
	
	if(request.getParameter("staff_name") != null)
		staff_name = request.getParameter("staff_name");
	if(request.getParameter("project_name") != null)
		project_name = request.getParameter("project_name");
	if(request.getParameter("date_from") != null)
		date_from = request.getParameter("date_from");
	if(request.getParameter("date_to") != null)
		date_to = request.getParameter("date_to");						
	
	ArrayList spend = (ArrayList)request.getAttribute("spend");
	
	//System.out.println("staff_name:"+staff_name);
	//System.out.println("project_name:"+project_name);
	//System.out.println("date_from:"+date_from);
	//System.out.println("date_to:"+date_to);
	//System.out.println("spend:"+spend);
	
	ChangeNum num = new ChangeNum();
	
%>
<body>
<h2>Everyday Spend Report</h2>
<table>
<%
	if(staff_name.length() != 0)
	{
%>
<tr>		
	<td>Staff No.: </td>
	<td><%= staff_name %></td>
</tr>
<%
	}
	if(project_name.length() != 0)
	{
%>
<tr>		
	<td>Project Name: </td>
	<td><%= project_name %></td>
</tr>
<%
	}
	if(date_from.length() != 0)
	{
%>
<tr>
	<td>Date From: </td>
	<td><%= date_from %></td>
</tr>
<%
	}
	if(date_to.length() != 0)
	{
%>
<tr>
	<td>Date To: </td>
	<td><%= date_to %></td>
</tr>
<%
	}
%>
</table>

<br>

<table border=1>

<tr>
	<td nowrap>
		<b>Staff Name</b>
	</td>
	<td nowrap>
		<b>Staff No.</b>
	</td>	
	<td nowrap>
		<b>Project</b>
	</td>
	<td nowrap>
		<b>Job</b>
	</td>
	<td nowrap>
		<b>Date</b>
	</td>
	<td nowrap>
		<b>Week Day</b>
	</td>
	<td nowrap>
		<b>Spend</b>
	</td>
</tr>

<%
	for(int i=0;i<spend.size();i++)
	{
		String[] arraySpend = new String[7];
		arraySpend = (String[])spend.get(i);
%>
<tr>
	<td nowrap>
		<%= arraySpend[0] %>
	</td>
	<td nowrap>
		<%= arraySpend[1] %>
	</td>
	<td nowrap>
		<%= arraySpend[2] %>
	</td>
	<td nowrap>
		<%= arraySpend[3] %>
	</td>
	<td nowrap>
		<%= arraySpend[4] %>
	</td>
	<td nowrap>
		<%= arraySpend[5] %>
	</td>
	<td align="right">
		<%= num.getFixNum(arraySpend[6],2) %>
	</td>	
</tr>
<%	}	%>

</table>

<br>
<hr>
<p>
<INPUT type=button value=Back onclick="location.href='<%=contextPath%>/tss/dayspendreport/DaySpendExport.jsp'">
</p>
</body>
<%@ include file="../tssfooter.jsp" %>
</html>

